// @algorithm @lc id=100292 lang=cpp
// @title er-jin-zhi-zhong-1de-ge-shu-lcof

#include "algm/algm.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
    int hammingWeight(uint32_t n) {
        int ans = 0;
        while (n) {
            ans += (n & 1);
            n = n >> 1;
        }
        return ans;
    }
};